package com.heima.user.controller.v1;

import com.heima.common.constants.UserContants;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.model.user.dtos.AuthUpdateDto;
import com.heima.user.service.ApUserAuthService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class ApUserAuthController {
    @Autowired
    private ApUserAuthService apUserAuthService;

    @PostMapping("/list")
    public ResponseResult authList(@RequestBody AuthDto dto){
         return apUserAuthService.authList(dto);
    }

    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthUpdateDto dto){
        return apUserAuthService.authUpdate(dto, UserContants.USER_AUTH_STATUS_PASS);
    }
}
